| Conditions | 2 |
| Total Lines | 13 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { |
||
| 27 | |||
| 28 | @Post() |
||
| 29 | @Roles(UserRole.COOPERATOR, UserRole.EMPLOYEE) |
||
| 30 | @ApiOperation({summary: 'Create new task'}) |
||
| 31 | public async index(@Body() taskDto: TaskDTO) { |
||
| 32 | try { |
||
| 33 | const id = await this.commandBus.execute( |
||
| 34 | new CreateTaskCommand(taskDto.name) |
||
| 35 | ); |
||
| 36 | |||
| 37 | return {id}; |
||
| 38 | } catch (e) { |
||
| 39 | throw new BadRequestException(e.message); |
||
| 40 | } |
||
| 43 |